using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AXBC = Microsoft.Dynamics.BusinessConnectorNet;
using AXMD = Microsoft.Dynamics.Framework.Metadata.Ax;
using Proxy = Microsoft.Dynamics.Framework.BusinessConnector.Proxy;

namespace DynamicsAXPS
{
    public static class AXExtensions
    {
        public static IEnumerable<Proxy.TreeNode> AsEnumerable(this Proxy.TreeNodeIterator iter)
        {
            while (true)
            {
                Proxy.TreeNode n = iter.next();
                if (n == null)
                {
                    break;
                }
                yield return n;
            }
        }
    }
}
